Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deprecated input object fields in introspection query (fixes #1241) #1291

Merged

Conversation

jgautsch
Copy link
Contributor

@jgautsch jgautsch commented Jan 3, 2024

I was setting up Apollo iOS in a new mobile app project, hoping to have it talk to my absinthe API. Apollo introspects the schema to generate types, however the introspection query wasn't processable by absinthe.

The issue was the (includeDeprecated: true) param passed to various fields including inputFields.

The includeDeprecated arg for input fields was merged into the graphql spec back in Aug 2022.

This PR brings absinthe up to support that arg, and makes Apollo's introspection query work.

Feedback welcome!

@jgautsch
Copy link
Contributor Author

jgautsch commented Jan 3, 2024

Fixes #1241

Copy link
Contributor

@benwilson512 benwilson512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for taking this on! I have those minor code tweaks and otherwise this looks good to go.

lib/absinthe/type/built_ins/introspection.ex Outdated Show resolved Hide resolved
lib/absinthe/type/built_ins/introspection.ex Outdated Show resolved Hide resolved
Because `!is_deprecated || (is_deprecated && show_deprecated)` is equivalent to just `!is_deprecated || show_deprecated`
@jgautsch
Copy link
Contributor Author

jgautsch commented Jan 4, 2024

@benwilson512 Good callout– updated PR. There was another existing chunk following the same flat_map pattern, I went ahead and updated it to Map.values() |> Enum.filter() as well for consistency. I also pushed a commit to simplify the boolean expressions.

Thanks for creating & maintaining absinthe! It's wonderful.

@jgautsch jgautsch requested a review from benwilson512 January 4, 2024 22:14
@jgautsch jgautsch requested a review from benwilson512 January 5, 2024 04:50
@jgautsch
Copy link
Contributor Author

jgautsch commented Jan 8, 2024

@benwilson512 lmk if there are any other improvements you'd see prior to merging

@jgautsch
Copy link
Contributor Author

@benwilson512 any other changes you'd suggest prior to being able to merge?

Copy link
Contributor

@benwilson512 benwilson512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants